<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<form action="" enctype="multipart/form-data" method="post">
    <input name="file" id="file" type="file"/>
    <div onclick=upload()>Submit</div>
</form>

<script>
    function upload(){
        var file = document.getElementById("file");
        var formdata = new FormData();
        formdata.append("file",file);
        var ajax = new XMLHttpRequest;
        ajax.upload.addEventListener("progress",progressHandler,false);
        ajax.addEventListener("load",completeHandler,false);
        ajax.addEventListener("error",errorHandler,false);
        ajax.addEventListener("abort",abortHandler,false);
        ajax.open("post", "file_upload_passer.php");
        ajax.send(formdata);
    }

    function progressHandler(){}
    function completeHandler(){}
    function errorHandler(){}
    function abortHandler(){}

</script>

</body>
</html>